package ${packageName}.entity;

<#list entityImportList as import>
import ${import};
</#list>

/**
 * ${functionName}对象 ${tableName}
 * 
 * @author ${author}
 * @date ${datetime}
 */
<#if hasDictField >
@DictCheck
</#if>
<#if hasFuncExport>
@ColumnWidth(30)
</#if>
@TableName("${tableName}")
public class ${ClassName}<#if hasSuperClass> extends ${table.parentClassName0}</#if> implements BaseEntity{

<#-- 字段属性-开始 ================================= -->
<#list columns as column>
<#-- 主键字段-开始 ----- -->
	<#if column.pk> 
    /** 主键 */
<#-- 是否要导出-开始 ------- -->
		<#if hasFuncExport>
			<#if column.list>
    @ExcelProperty("序号")
    		<#else>
    @ExcelIgnore
    		</#if>
    	</#if>	
<#-- 是否要导出-结束 ------- -->
    @Null(groups = Add.class, message="${column.javaField}必须为空")
    	<#if column.increment>
    @TableId(type = IdType.AUTO)
    	<#else>
    @TableId(type = IdType.ASSIGN_ID)
    	</#if>
    private String ${column.javaField};
    
<#-- 主键字段-结束 -------  -->
	<#else>
<#-- 普通字段-开始 --------- -->
    /** ${column.columnComment} */
<#-- 是否要导出-开始 --------- -->
		<#if hasFuncExport> 
			<#if column.list> 
				<#if column.dictCode != ''> 
    @ExcelProperty(value = "${column.javaFieldDesc}", converter = DictConverter.class)
    			<#else>
    @ExcelProperty("${column.javaFieldDesc}")
    			</#if>
    		<#else>
    @ExcelIgnore
    		</#if>
    	</#if>
<#-- 是否要导出-结束 --------- -->
<#-- 字段校验-开始 --------- -->
		<#if (hasFuncInsert || hasFuncUpdate) && column.edit && column.required> 
			<#if column.strDataType> 
    @NotBlank(message = "${column.javaFieldDesc}不能为空")
    		<#else>
    @NotNull(message = "${column.javaFieldDesc}不能为空")
    		</#if>
    	</#if>
    	<#if (hasFuncInsert || hasFuncUpdate) && column.edit && column.strDataType> 
    @Size(max = ${column.javaLength?c}, message = "${column.javaFieldDesc}长度不能超过${column.javaLength?c}个字符")
    	</#if>
<#-- 字段校验-结束 --------- -->
<#-- 日期序列化格式-开始 ----------- -->
		<#if column.htmlType == 'date'> 
    @JsonFormat(pattern = DateUtil.PATTERN_YYYY_MM_DD)
    	<#elseif column.htmlType == "datetime">
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    	</#if>
<#-- 日期序列化格式-结束 ------------ -->
		<#if column.dictCode != ''>
    @DictValid(message = "无效的${column.javaFieldDesc}")
    @Dict(dictCode = "${column.dictCode}")
    	</#if>
    	<#if column.javaField == 'createTime'> 
    @TableField(fill = FieldFill.INSERT)
    	<#elseif column.javaField == 'updateTime'> 
    @TableField(fill = FieldFill.UPDATE)
    	</#if>
    private ${column.javaType} ${column.javaField};

    </#if>
<#-- 普通字段-结束 ------------- -->
</#list>
<#-- 字段属性-结束 ================================ -->

<#-- getter和setter方法-开始 -->
<#list columns as column>
	<#if column.pk> 
    public void set${column.attrName}(String ${column.javaField}) {
        this.${column.javaField} = ${column.javaField};
    }

    public String get${column.attrName}() {
        return ${column.javaField};
    } 

    <#else>
    public void set${column.attrName}(${column.javaType} ${column.javaField}) {
        this.${column.javaField} = ${column.javaField};
    }

    public ${column.javaType} get${column.attrName}() {
        return ${column.javaField};
    }    
    
    </#if>
</#list>
<#-- getter和setter方法-结束 -->

}
